package com.jsp.app.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jsp.app.service.Zhang_CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import com.tamll.bean.Category;

@Controller
public class CategoryController {

    @Autowired
    private Zhang_CategoryService zhang_categoryService;

    @GetMapping("CategoryPage")
    public ModelAndView CategoryPage01(){
        Page<Category> CategoryIPage = zhang_categoryService.Category();
        List<Category> records = CategoryIPage.getRecords();
        ModelAndView mav = new ModelAndView();
        mav.setViewName("admin/categoryManagePage");
        mav.addObject("CategoryList",records);
        return mav;
    }
}
